<?php

/**
 * zc_user_info form base class.
 *
 * @method zc_user_info getObject() Returns the current form's model object
 *
 * @package    zc
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class Basezc_user_infoForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'info_id'      => new sfWidgetFormInputHidden(),
      'user_name'    => new sfWidgetFormInputText(),
      'info_sex'     => new sfWidgetFormChoice(array('choices' => array('男' => '男', '女' => '女'))),
      'info_compay'  => new sfWidgetFormInputText(),
      'info_mobel'   => new sfWidgetFormInputText(),
      'area_no'      => new sfWidgetFormInputText(),
      'tel'          => new sfWidgetFormInputText(),
      'qq'           => new sfWidgetFormInputText(),
      'msn'          => new sfWidgetFormInputText(),
      'other_im'     => new sfWidgetFormInputText(),
      'email'        => new sfWidgetFormInputText(),
      'birthday'     => new sfWidgetFormDate(),
      'recommended'  => new sfWidgetFormInputText(),
      'from_keyword' => new sfWidgetFormInputText(),
      'from_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('zc_from'), 'add_empty' => true)),
      'area_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('zc_area'), 'add_empty' => true)),
      'industry_id'  => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('zc_industry'), 'add_empty' => true)),
      'user_id'      => new sfWidgetFormInputText(),
    ));

    $this->setValidators(array(
      'info_id'      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('info_id')), 'empty_value' => $this->getObject()->get('info_id'), 'required' => false)),
      'user_name'    => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'info_sex'     => new sfValidatorChoice(array('choices' => array(0 => '男', 1 => '女'), 'required' => false)),
      'info_compay'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'info_mobel'   => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'area_no'      => new sfValidatorInteger(array('required' => false)),
      'tel'          => new sfValidatorInteger(array('required' => false)),
      'qq'           => new sfValidatorInteger(array('required' => false)),
      'msn'          => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'other_im'     => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'email'        => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'birthday'     => new sfValidatorDate(array('required' => false)),
      'recommended'  => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'from_keyword' => new sfValidatorString(array('max_length' => 255, 'required' => false)),
      'from_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('zc_from'), 'required' => false)),
      'area_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('zc_area'), 'required' => false)),
      'industry_id'  => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('zc_industry'), 'required' => false)),
      'user_id'      => new sfValidatorInteger(array('required' => false)),
    ));

    $this->widgetSchema->setNameFormat('zc_user_info[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'zc_user_info';
  }

}
